<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/3/29 0029
 * Time: 21:36
 */

namespace Route;
class Round
{
    static $lastIndex = 0;

    public static function select(array $list)
    {
        $currentIndex = self::$lastIndex;
//        echo '当前的服务索引' . self::$lastIndex;
        if ($currentIndex + 1 > count($list) - 1) {
            self::$lastIndex = 0;
        } else {
            self::$lastIndex++;
        }
        $url = $list[$currentIndex];
        return $url;
    }
}